﻿using UnityEngine;
using UnityEngine.UI;
using UnityEditor;
using Jinndev;

namespace JinndevEditor {

    public static class CoreEditorMenu {

        [MenuItem(CommonEditorConst.EditorMenu + "/打开PersistentDataPath文件夹")]
        public static void OpenPersistentDataPath() {
            EditorUtility.OpenWithDefaultApp(Application.persistentDataPath);
        }

        [MenuItem(CommonEditorConst.EditorMenu + "/开关UIRaycast辅助线")]
        public static void ToggleUIRaycastGizmos() {
            GameObject obj = GameObject.Find("DebugUIRaycast");
            if (obj == null) {
                obj = new GameObject("DebugUIRaycast", new System.Type[] { typeof(DebugUIRaycast) });
                obj.hideFlags = HideFlags.DontSave;
            }
            else {
                Object.DestroyImmediate(obj);
            }
        }

        [MenuItem(CommonEditorConst.EditorMenu + "/检查未使用资源")]
        public static void CheckeUnunsedResource() {
            UnunsedResourceChecker.ShowWindow();
        }

        [MenuItem(CommonEditorConst.EditorMenu + "/ClearProgressBar")]
        public static void ClearProgressBar() {
            EditorUtility.ClearProgressBar();
        }

    }

}
